<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>




</head>

<body>

    <input type="text" style="margin-right: 10px;"><button>发送</button>








</body>

<script>
    var bu = document.getElementsByTagName('button');
    console.log(bu[0]);


    bu[0].addEventListener('click', function() {
        var i = 5;
        bu[0].innerHTML = '还剩下' + (i--) + '秒再次点击';
        bu[0].disabled = true;
        var s = setInterval(function() {
            if (i > 0) {
                bu[0].innerHTML = '还剩下' + (i--) + '秒再次点击';

            } else {

                clearInterval(s);
                bu[0].innerHTML = '发送';
                bu[0].disabled = false;
            }
        }, 1000);

    })
</script>

</html>